<%--
  Created by IntelliJ IDEA.
  User: Administer
  Date: 2020/12/8
  Time: 15:11
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>

    <link rel="stylesheet" href="element-ui/lib/theme-chalk/index.css">
    <script src="js/vue.js"></script>
    <script src="element-ui/lib/index.js"></script>
    <script src="js/axios-0.18.0.js"></script>
    <script src="js/qs.js"></script>

</head>
<body>
<div id="app" >
    <el-input v-model="info" placeholder="请输入内容"  style="width: 300px"></el-input>
    <el-button type="primary" @click="query">搜索</el-button>
    <template>
        <el-table :data="tableData" style="width: 100%"><el-table-column
                prop="id"
                label="序号"
                width="180">
        </el-table-column>
            <el-table-column
                    prop="name"
                    label="姓名"
                    width="180">
            </el-table-column>
            <el-table-column
                    prop="money"
                    label="存款">
            </el-table-column>
        </el-table>
    </template>
</div>
<script>
    new Vue({
        el:"#app",
        data:{
            tableData: [],
            info:'',
        },
        methods:{
            query(){
                axios.post("http://localhost/find",Qs.stringify(
                    {name:this.info})).then(resp=>{
                        console.log(resp)
                    // this.tableData.push(resp.data);

                    // this.tableData=resp.data
                    this.tableData=resp.data
                }).catch(e=>{
                    e.assign
                })
            }
        }
    })
</script>
</body>
</html>
